// 例子5

{
    const PI = 3.1415926
    console.log(PI); // 3.1415926
    try {
        PI = 3; // Uncaught TypeError: Assignment to constant variable
    } catch (e) {
        console.error(e)
    }
}

console.log('--------------------------------------------------')

{
    try {
        const MAX; // Uncaught SyntaxError: Missing initializer in const declaration
    } catch (e) {
        console.error(e)
    }

    MAX = 10;
}

console.log('--------------------------------------------------')

{
    function fn() {
        const MIN = 1;
    }

    try {
        console.log(MIN); // Uncaught ReferenceError: MIN is not defined
    } catch (e) {
        console.error(e)
    }

}

console.log('--------------------------------------------------')

{
    try {
        console.log(REG); // Uncaught ReferenceError: REG is not defined
    } catch (e) {
        console.error(e)
    }

    const REG = /\d+/;
}